#!/bin/bash

echo '更新apt'
apt update
apt upgrade -y

echo '安装git python3.8 pip中……'
apt install git python3.8 python3-pip -y
ln -sf python3.8 /usr/bin/python
ln -sf /usr/bin/pip3 /usr/bin/pip
python -m pip install --upgrade pip
echo '完成安装'

echo '安装nodejs中……'
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
apt-get install -y nodejs
echo '安装完成'

echo '安装并启动redis'
apt-get install redis -y
redis-server --daemonize yes --save 900 1 --save 300 10
echo '安装且启动完成'

echo '安装chromuim，中文字体等'
sudo apt install chromium-browser -y
apt-get install -y --force-yes --no-install-recommends fonts-wqy-microhei
apt-get install -y --force-yes --no-install-recommends ttf-wqy-zenhei


cd ~/
echo '正在克隆云崽……'
git clone https://github.com/Hoshinonyaruko/Yunzai-Bot.git
cd Yunzai-Bot
npm install pnpm -g
pnpm install -P
echo '云崽克隆完成'